<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css" media="print,screen">
        body{height: 100%;}
        #table-wrapper{
            width: 100%;
            -webkit-print-color-adjust:exact;
            print-color-adjust: exact;
            color-adjust:exact; 
            background-color: rebeccapurple;
            /* border: 1px solid #333; */
            height: 1200px;
        }
        #abc{
            /* 解决打印时没有背景颜色的问题*/
           -webkit-print-color-adjust:exact;
            print-color-adjust: exact;
            color-adjust:exact; 
                background-color: green;
                font-size: 16px;
                height: 100%;
                width: 100%;
                border: 3px solid #333;
            }
    </style>
     <style type="text/css">
        

        @media print{
            @page {
                    size: A4 landscape;
                    margin: 0;
                }
            body {
                -webkit-print-color-adjust:exact;
            print-color-adjust: exact;
            color-adjust:exact; 
                    background-color: yellow;
                    color: black;
                    border: 1px solid #333;
                    padding: 5px;
                    
                }
            /* #abc{
                background-color: green;
                font-size: 16px;
            } */
        }

    </style>
</head>
<body>
    <div id="table-wrapper" >
        <table id="abc">
            <thead><tr><th>姓名</th><th>身高</th></tr></thead>
            <tbody>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <!-- <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr>
                <tr><td>赵国豪</td><td>170</td></tr> -->
            </tbody>
           
        </table>
       
    </div>
</body>
</html>